<div class="partner">
<h3>Partner</h3>
<form id="notify" method="post" action="<?php echo $this->url(array(), 'bizprofile_partner_notify_show'); ?>" >
    <div class="notify">
        <?php if ($this->numNotify && $this->numNotify > 0): ?>
            <div class="notify-show"><?php echo $this->numNotify ?></div>
        <?php endif ?>
    </div>
</form>
<?php if($this->enterprise): ?>
    <?php if($this->user_entity >= 3) : ?>
        <?php if ($this->status == "none"): ?>
            <form method="post" action="<?php echo $this->url(array(), 'bizprofile_partner_add_partner'); ?>" id="addPartner">
                <?php echo $this->tokenElement; ?>
                <input type="hidden" name="enterprise_id" value="<?php echo $this->enterprise_id; ?>"/>
                <input type="hidden" name="relation_id" value="<?php echo $this->relation_id; ?>"/>
                <input type="hidden" name="redirect_url" value="<?php echo $this->url(array(),$this->purl); ?>"/>
                <div class="confirm">
                <button class="biz-button" type="submit"><span><?php echo $this->translator()->widget('partner_add_as_partner'); ?></span></button>
                </div>
            </form>
        <?php elseif ($this->status == "confirm"): ?>
            <form id="confirm" method="post" action="<?php echo $this->url(array(), 'bizprofile_partner_confirm_partner'); ?>" id="confirmPartner">
                <?php echo $this->tokenElement; ?>
                <input type="hidden" name="enterprise_id" value="<?php echo $this->enterprise_id; ?>"/>
                <input type="hidden" name="relation_id" value="<?php echo $this->relation_id; ?>"/>
                <input type="hidden" name="redirect_url" value="<?php echo $this->url(array(),$this->purl); ?>"/>
                <div class="confirm">
                    <button class="biz-button" type="submit"><?php echo $this->translator()->widget('partner_confirm_partner'); ?></button>
                </div>
            </form>
        <?php elseif ($this->status == "yes"): ?>
            <form id="removePartner" method="post" action="<?php echo $this->url(array(), 'bizprofile_partner_remove_partner'); ?>" id="removePartner">
                <?php echo $this->tokenElement; ?>
                <input type="hidden" name="enterprise_id" value="<?php echo $this->enterprise_id; ?>"/>
                <input type="hidden" name="relation_id" value="<?php echo $this->relation_id; ?>"/>
                <input type="hidden" name="redirect_url" value="<?php echo $this->url(array(),$this->purl); ?>"/>
                <div class="relation" >
                    <?php echo $this->translator()->widget('partner_ispartner'); ?>
                </div>
            </form>
        <?php else: ?>
        <div class="confirm">
            <p><?php echo $this->translator()->widget('partner_waiting_respone'); ?></p>
            </div>
        <?php endif ;?>
    <?php endif; ?>
<?php endif; ?>
<div style="clear:both;"></div>
<hr/>
<?php if($this->enterprise): ?>
    <?php if($this->user_entity >= 3) : ?>

        <h3>Message</h3>
        <hr/>
        <a href="<?php echo $this->url(array('enterprise_id' => $this->enterprise->id), 'bizprofile_message_add'); ?>">Private Message</a>
    <?php endif; ?>
<?php endif; ?>
</div>

<script type="text/javascript" charset="utf-8">
    $(function(){
        $(".notify").click(function(){
            $("#notify").submit();
        });

        $(".relation").click(function(){
            if (confirm("<?php echo $this->translator()->widget('partner_remove_partner'); ?>"))
            {
                $("#removePartner").submit();
            }
        });
    });
</script>